package com.caigou.modules.famous.adpter

import android.text.TextUtils
import com.caigou.comm.base.utils.ImageLoader
import com.caigou.modules.famous.R
import com.caigou.modules.famous.bean.SubscribeItemBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @author #Suyghur.
 * Created on 2021/12/08
 */
class SubscribeItemAdapter(dataset: MutableList<SubscribeItemBean>) :
    BaseQuickAdapter<SubscribeItemBean, BaseViewHolder>(R.layout.item_subscribe_list, dataset) {


    override fun convert(holder: BaseViewHolder, item: SubscribeItemBean) {
        if (TextUtils.isEmpty(item.headImg)) {
            holder.setImageResource(R.id.item_subscribe_iv_avatar, R.drawable.img_comm_avatar)
        } else {
            ImageLoader.loadCircle(context, item.headImg, holder.getView(R.id.item_subscribe_iv_avatar))
        }

        holder.setText(R.id.item_subscribe_tv_nickname, item.nickName)
        holder.setText(R.id.item_subscribe_tv_desc, item.dareTypeName)

    }
}